package org.test;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
/*The entry of application
 * When the user sign's in the tab changes for logged in user.
 * All the new tab bar is setup using this class.
 * */
public class UserLogedInPageActivity extends TabActivity {

	private String Student_ID;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		Bundle extras = getIntent().getExtras();

		if (extras == null) {
			return;
		}
		Student_ID = (String) extras.getSerializable("ID");

		TabHost host = getTabHost();

		Resources r = getResources();

		host.addTab(host.newTabSpec("Map").setIndicator("",
				r.getDrawable(R.drawable.sell)).setContent(
				new Intent(this, SellBooksActivity.class).putExtra("ID",
						Student_ID)));
		host.addTab(host.newTabSpec("Map").setIndicator("",
				r.getDrawable(R.drawable.mybooks)).setContent(
				new Intent(this, LogedInUserDetailsPageActivity.class)
						.putExtra("ID", Student_ID)));

		host.addTab(host.newTabSpec("Map").setIndicator("",
				r.getDrawable(R.drawable.buy)).setContent(
				new Intent(this, DisplayCourseNumberPresentActivity.class)
						.putExtra("ID", Student_ID)));
		host.addTab(host.newTabSpec("Map").setIndicator("",
				r.getDrawable(R.drawable.search)).setContent(
				new Intent(this, SearchBooksActivity.class).putExtra("TAB",
						"Map")));

	}

}